import { forwardRef, useImperativeHandle, useState } from 'react';
import { Mask } from 'antd-mobile';
import s from './index.less';

const Modal = forwardRef((props, ref) => {
  const [visible, setVisible] = useState(false);

  useImperativeHandle(ref, () => ({
    setVisible,
  }));

  return (
    <Mask visible={visible} onMaskClick={() => setVisible(false)}>
      <section className={s.wrapper}>Modal</section>
    </Mask>
  );
});

export default Modal;
